GetThemeMenuItemExtra
NEW WITH THE APPEARANCE MANAGER
Gets of measurement of the space (in pixels) surrounding a menu item in the current theme.
pascal OSStatus GetThemeMenuItemExtra ( ThemeMenuItemType inItemType, SInt16 *outHeight, SInt16 *outWidth);
inItemType
- A constant of type
ThemeMenuItemType
, identifying the type of menu item for which you are interested in getting a measurement. See "Appearance-Compliant Menu Item Type Constants".outHeight
- On output, the value (in pixels) of the total amount of padding between the content of the menu item and the top and bottom of its frame. Your content's height plus the measurement provided by the
outHeight
parameter equals the total item height.outWidth
- On output, the value (in pixels) of the total amount of padding between the content of the menu item and the left and right limits of the menu. Your content's width plus the measurement provided by the
outWidth
parameter equals the total item width.- function result
- A result code; see "Result Codes".
DISCUSSION
TheGetThemeMenuItemExtra
function should be called when you are writing your own menu definition function and wish to be Appearance-compliant. Once you have determined the height and width of the content of a menu item, callGetThemeMenuItemExtra
to get a measurement in pixels of the space surrounding a menu item, including any necessary inter-item spacing, for the current theme. By combining the values for your menu item's content and the extra padding needed by the theme, you can derive the size of the rectangle needed to encompass both the content and the theme element together.SPECIAL CONSIDERATIONS
Make sure Appearance Manager 1.0.1 is present before calling theGetThemeMenuItemExtra
function. See "Appearance Manager Gestalt Selector Constants" for details on how to determine if the Appearance Manager is present and what its version is, if so.